<% if current_user && Time.now - current_user.created_at < 1.week %>

  <div class="alert alert-success">
    <button type="button" class="close" data-dismiss="alert">×</button>

    <h2><%= translation('dashboard.dashboard.welcome') %></h2>

    <%= translation('dashboard.dashboard.description') %>

    <br>
    <%= translation('dashboard.dashboard.get_started') %>
    <br><br>
    <p>
      <a class="btn btn-sm btn-light" href="/questions" target="_blank">
        <%= translation('dashboard.dashboard.ask_question') %>
      </a>

      <a class="btn btn-sm btn-light" href="/methods" target="_blank">
        <%= translation('dashboard.dashboard.explore_projects') %>
      </a>
    </p>
  </div>

<% end %>

<div class="dashboard container">

  <div class="row">

    <div class="col-lg-8">

      <%= render partial: "dashboard/header" %>

      <div class="dashboard-blog">

        <% if @blog %>

          <% if @blog.main_image %>
            <div class="img" style="background-image: url('<%= @blog.main_image.path(:large) %>')">
          <% elsif @blog.scraped_image %>
            <div class="img" style="background-image: url('<%= @blog.scraped_image %>')">
          <% end %>

          <div class="blog-caption">

            <h4>
              <small class="float-right d-none d-lg-inline"><%= raw translation('dashboard.dashboard.from_blog', :url => '/blog') %></small>
              <a class="title" href="/blog"><%= @blog.title %></a>
              <small><%= translation('dashboard.dashboard.by') %>
                <a href="/profile/<%= @blog.author.username %>"><%= @blog.author.username %></a></small>
            </h4>

          </div>

          <% if @blog.main_image || @blog.scraped_image %>
            </div>
          <% end %>

        <% end %>

        <%= render partial: "dashboard/activity", locals: {activity: @activity, notes: @notes} %>

        </div>

      </div>

      <div class="col-lg-4 mt-5 mt-lg-0">

        <%= feature('dashboard-feature') %>

        <%= render partial: "sidebar/dashboard" %>

      </div>

    </div>

  </div>
</div>
<%= stylesheet_link_tag "dashboard" %>
<%= javascript_include_tag "dashboard" %>
